<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="t" uri="springleaf-tag" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>消息</title>
<script type="text/javascript" src="${base}/js/jquery/jquery-1.10.1.js"></script>
<script type="text/javascript" src="${base}/js/bootstrap/js/bootstrap.js"></script>
<script type="text/javascript" src="${base}/js/msg/msg.js"></script>
<link href="${base}/js/bootstrap/css/bootstrap.css"  rel="stylesheet" media="screen" />
<link href="${base}/js/bootstrap/css/bootstrap-responsive.css"  rel="stylesheet" media="screen" />
<%-- <link href="${base}/js/bootstrap/css/todc-bootstrap.css"  rel="stylesheet" media="screen" /> --%>
<style>
   body {
     padding-top: 60px; 
   }
 </style>
</head>
<body>
	<div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Springleaf</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="#">Home</a></li>
              <li><a href="#about">About</a></li>
              <li><a href="#contact">Contact</a></li>
            </ul>
          </div><!--/.nav-collapse -->
        </div>
      </div>
    </div>

    <div class="container">

   <h2>Msg manager</h2>
   	  <a class="add btn btn-info" href="#"><i class="icon-leaf"></i> 新增</a>
   	  <br /><br />
	  <table class="table table-bordered table-hover table-condensed">
	  	<tr>
		  	<th width="10%">ID</th>
		  	<th width="30%">标题</th>
		  	<th width="50%">内容</th>
		  	<th width="10%">操作</th>
	  	</tr>
	  	<c:forEach items="${msgList}" var="msg">
	  	<tr>
	  		<td>${msg.id}</td>
	  		<td>${msg.title}</td>
	  		<td>${msg.content}</td>
	  		<td>
	  			<div class="btn-group">
				  <a class="btn btn-primary edit"><i class="icon-edit icon-white"></i> 编辑
				  <input type="hidden" name="id" value="${msg.id}">
				  <input type="hidden" name="title" value="${msg.title}">
				  <input type="hidden" name="content" value="${msg.content}">
				  </a>
				  <a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
				  <ul class="dropdown-menu">
				    <li><a href="/msg/delete/${msg.id}"><i class="icon-remove"></i> 删除</a></li>
				    <li class="divider"></li>
				  </ul>
				</div>
	  		</td>
	  	</tr>
	  	</c:forEach>
	  </table>
    </div> <!-- /container -->

	<div id="msgFormDiv" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
		<div class="modal-header">
		  <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
		  <h3 id="myModalLabel">Msg添加</h3>
		</div>
		<div class="modal-body">
			<form id="msgForm" class="form-horizontal" method="post">
			    <fieldset>
			    <div class="control-group">
		          <label class="control-label">标题</label>
		          <div class="controls">
		            <div class="input-prepend">
		              <span class="add-on">^_^</span>
		              <input class="span2" placeholder="placeholder" name="title" type="text">
		            </div>
		          </div>
		        </div>
				<input type="hidden" name="id" value="" />
			    <div class="control-group">
		          <label class="control-label">内容:</label>
		          <div class="controls">
		            <div class="textarea">
		                  <textarea name="content" style="margin: 0px; height: 98px; width: 232px;"> </textarea>
		            </div>
		          </div>
		        </div>
			    </fieldset>
			    <t:token />
			  </form>
		  </div>
	      <div class="modal-footer">
		    <button id="saveChange" type="submit" class="btn btn-primary">保存</button>
		    <button class="btn btn-danger" data-dismiss="modal" aria-hidden="true">关闭</button>
		  </div>
	</div>
	
 <!-- 
	<!-- Modal --
	<div id="myModal" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
	  <div class="modal-header">
	    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
	    <h3 id="myModalLabel">Modal header</h3>
	  </div>
	  <div class="modal-body">
	    <p>One fine body…</p>
	  </div>
	  <div class="modal-footer">
	    <button class="btn" data-dismiss="modal" aria-hidden="true">关闭</button>
	    <button class="btn btn-primary">Save changes</button>
	  </div>
	</div>
 -->
</body>
</html>